// @ts-ignore
/* eslint-disable */
import { PageData, PageParams } from '@/common/page';
import { request } from '@umijs/max';

export async function addModule(
  data: {
    [key: string]: any
  },
  options?: { [key: string]: any },
) {
  return request<{
    code: number;
    msg?: string;
    data?: Record<string, any>;
  }>('/engine-service/api/v1/stress_case_module/save', {
    method: 'POST',
    data,
    ...(options || {}),
  });
}

export async function updateModule(
  data: {
    [key: string]: any
  },
  options?: { [key: string]: any },
) {
  return request<{
    code: number;
    msg?: string;
    data?: Record<string, any>;
  }>('/engine-service/api/v1/stress_case_module/update', {
    method: 'PUT',
    data,
    ...(options || {}),
  });
}

export async function pageModule(
  data: PageParams,
  options?: { [key: string]: any },
) {
  return request<{
    code: number;
    msg?: string;
    data?: PageData;
  }>('/engine-service/api/v1/stress_case_module/page', {
    method: 'POST',
    data,
    ...(options || {}),
  });
}

export async function batchDelModule(data: { idList: number[] }, options?: { [key: string]: any }) {
  return request<{
    code: number;
    msg?: string;
    data?: Record<string, any>;
  }>('/engine-service/api/v1/stress_case_module/batch_delete', {
    data,
    method: 'DELETE',
    ...(options || {}),
  });
}
